Execute this jar, and point to your eclipse installation.
Copy lombok.jar to yourproject/lib
On your project options, add lib/lombok.jar on Java Build Path/Libraries
Now, your project is ready to use Lombok.
importjavax.persistence.*;importorg.openxava.annotations.*;importorg.openxava.model.*;importlombok.*;
@Entitypublic @Data class PruebaPrimera extends Identifiable {
@Column(length=50)privateString nombre;}
@Data annotation on class generates a lot of information. Getters, Setters, equal() hashCode() toString() ..... and maybe is enough for most of classes. But for more complex classes where you need to take more control over the "code generated", instead @Data over the complete class, you can use @Getter and @Setter annotations over each method. This allows the following code..
packagecom.testlombok.modelo;importjavax.persistence.*;importorg.openxava.annotations.*;importorg.openxava.model.*;importlombok.*;
@Entitypublicclass PruebaPrimera extends Identifiable {
@Column(length=50)private @Getter @Setter String nombre;// Here, Getter and Setter are autogenerated by Lombok
@Stereotype("HTML_TEXT")private @Getter String observaciones;// Here just Getter is autogenerated, to take control over Setter implementation.publicvoid setObservaciones(String observaciones){// your custom setter .. tu setter personalizadothis.observaciones= observaciones;}}
Lombok
To Use Lombok in your project:Now, your project is ready to use Lombok.
@Data annotation on class generates a lot of information. Getters, Setters, equal() hashCode() toString() ..... and maybe is enough for most of classes. But for more complex classes where you need to take more control over the "code generated", instead @Data over the complete class, you can use @Getter and @Setter annotations over each method. This allows the following code..